home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / include / linux / ipv6.h < prev    next >
C/C++ Source or Header  |  2008-10-24  |  3KB  |  159 lines

  1. #ifndef _IPV6_H
  2. #define _IPV6_H
  3.  
  4. #include <linux/in6.h>
  5. #include <asm/byteorder.h>
  6.  
  7. /* The latest drafts declared increase in minimal mtu up to 1280. */
  8.  
  9. #define IPV6_MIN_MTU    1280
  10.  
  11. /*
  12.  *    Advanced API
  13.  *    source interface/address selection, source routing, etc...
  14.  *    *under construction*
  15.  */
  16.  
  17.  
  18. struct in6_pktinfo {
  19.     struct in6_addr    ipi6_addr;
  20.     int        ipi6_ifindex;
  21. };
  22.  
  23.  
  24. struct in6_ifreq {
  25.     struct in6_addr    ifr6_addr;
  26.     __u32        ifr6_prefixlen;
  27.     int        ifr6_ifindex; 
  28. };
  29.  
  30. #define IPV6_SRCRT_STRICT    0x01    /* Deprecated; will be removed */
  31. #define IPV6_SRCRT_TYPE_0    0    /* Deprecated; will be removed */
  32. #define IPV6_SRCRT_TYPE_2    2    /* IPv6 type 2 Routing Header    */
  33.  
  34. /*
  35.  *    routing header
  36.  */
  37. struct ipv6_rt_hdr {
  38.     __u8        nexthdr;
  39.     __u8        hdrlen;
  40.     __u8        type;
  41.     __u8        segments_left;
  42.  
  43.     /*
  44.      *    type specific data
  45.      *    variable length field
  46.      */
  47. };
  48.  
  49.  
  50. struct ipv6_opt_hdr {
  51.     __u8         nexthdr;
  52.     __u8         hdrlen;
  53.     /* 
  54.      * TLV encoded option data follows.
  55.      */
  56. } __attribute__ ((packed));    /* required for some archs */
  57.  
  58. #define ipv6_destopt_hdr ipv6_opt_hdr
  59. #define ipv6_hopopt_hdr  ipv6_opt_hdr
  60.  
  61.  
  62. /*
  63.  *    routing header type 0 (used in cmsghdr struct)
  64.  */
  65.  
  66. struct rt0_hdr {
  67.     struct ipv6_rt_hdr    rt_hdr;
  68.     __u32            reserved;
  69.     struct in6_addr        addr[0];
  70.  
  71. #define rt0_type        rt_hdr.type
  72. };
  73.  
  74. /*
  75.  *    routing header type 2
  76.  */
  77.  
  78. struct rt2_hdr {
  79.     struct ipv6_rt_hdr    rt_hdr;
  80.     __u32            reserved;
  81.     struct in6_addr        addr;
  82.  
  83. #define rt2_type        rt_hdr.type
  84. };
  85.  
  86. /*
  87.  *    home address option in destination options header
  88.  */
  89.  
  90. struct ipv6_destopt_hao {
  91.     __u8            type;
  92.     __u8            length;
  93.     struct in6_addr        addr;
  94. } __attribute__ ((__packed__));
  95.  
  96. /*
  97.  *    IPv6 fixed header
  98.  *
  99.  *    BEWARE, it is incorrect. The first 4 bits of flow_lbl
  100.  *    are glued to priority now, forming "class".
  101.  */
  102.  
  103. struct ipv6hdr {
  104. #if defined(__LITTLE_ENDIAN_BITFIELD)
  105.     __u8            priority:4,
  106.                 version:4;
  107. #elif defined(__BIG_ENDIAN_BITFIELD)
  108.     __u8            version:4,
  109.                 priority:4;
  110. #else
  111. #error    "Please fix <asm/byteorder.h>"
  112. #endif
  113.     __u8            flow_lbl[3];
  114.  
  115.     __be16            payload_len;
  116.     __u8            nexthdr;
  117.     __u8            hop_limit;
  118.  
  119.     struct    in6_addr    saddr;
  120.     struct    in6_addr    daddr;
  121. };
  122.  
  123.  
  124. /* index values for the variables in ipv6_devconf */
  125. enum {
  126.     DEVCONF_FORWARDING = 0,
  127.     DEVCONF_HOPLIMIT,
  128.     DEVCONF_MTU6,
  129.     DEVCONF_ACCEPT_RA,
  130.     DEVCONF_ACCEPT_REDIRECTS,
  131.     DEVCONF_AUTOCONF,
  132.     DEVCONF_DAD_TRANSMITS,
  133.     DEVCONF_RTR_SOLICITS,
  134.     DEVCONF_RTR_SOLICIT_INTERVAL,
  135.     DEVCONF_RTR_SOLICIT_DELAY,
  136.     DEVCONF_USE_TEMPADDR,
  137.     DEVCONF_TEMP_VALID_LFT,
  138.     DEVCONF_TEMP_PREFERED_LFT,
  139.     DEVCONF_REGEN_MAX_RETRY,
  140.     DEVCONF_MAX_DESYNC_FACTOR,
  141.     DEVCONF_MAX_ADDRESSES,
  142.     DEVCONF_FORCE_MLD_VERSION,
  143.     DEVCONF_ACCEPT_RA_DEFRTR,
  144.     DEVCONF_ACCEPT_RA_PINFO,
  145.     DEVCONF_ACCEPT_RA_RTR_PREF,
  146.     DEVCONF_RTR_PROBE_INTERVAL,
  147.     DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
  148.     DEVCONF_PROXY_NDP,
  149.     DEVCONF_OPTIMISTIC_DAD,
  150.     DEVCONF_ACCEPT_SOURCE_ROUTE,
  151.     DEVCONF_MC_FORWARDING,
  152.     DEVCONF_DISABLE_IPV6,
  153.     DEVCONF_ACCEPT_DAD,
  154.     DEVCONF_MAX
  155. };
  156.  
  157.  
  158. #endif /* _IPV6_H */
  159.